import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/Index.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/index',
    name: 'Index',
    component: Index,
    redirect:'/index/home',
    children:[
      {
        path: 'home',
        name: 'Home',
        component: () => import(/* webpackChunkName: "about" */ '../views/home.vue')
      },
      {
        path: 'shop',
        name: 'Shop',
        component: () => import(/* webpackChunkName: "about" */ '../views/Shop.vue')
      },
      {
        path: 'server',
        name: 'Server',
        component: () => import(/* webpackChunkName: "about" */ '../views/Server.vue')
      },
      {
        path: 'mine',
        name: 'Mine',
        component: () => import(/* webpackChunkName: "about" */ '../views/Mine.vue')
      },
    ]
  },
 
  {
    path: '/grade',
    name: 'Grade',
    component: () => import(/* webpackChunkName: "grade" */ '../views/Grade.vue')
  },
  {
    path: '/medal',
    name: 'Medal',
    component: () => import(/* webpackChunkName: "medal" */ '../views/Medal.vue')
  },
  {
    path: '/coupon',
    name: 'Coupon',
    component: () => import(/* webpackChunkName: "medal" */ '../views/Coupon.vue')
  },
  {
    path: '/signin',
    name: 'Signin',
    component: () => import(/* webpackChunkName: "medal" */ '../views/Signin.vue')
  },
  {
    path: '/comment',
    name: 'Comment',
    component: () => import(/* webpackChunkName: "medal" */ '../views/Comment.vue')
  },
  {
    path: '/order',
    name: 'Order',
    component: () => import(/* webpackChunkName: "grade" */ '../views/Order.vue')
  },

  {
    path:"**",
    redirect:"/index"
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
